package com.yadang.oom;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * @author: 亚当
 * @date: 2023年02月26日 17:08
 * @package: com.yadang.oom
 * @Description: OutOfMemoryError
 */

public class OOMTest {
    public static void main(String[] args) {
        // 参数配置-Xms5M -Xms5M -Xlog:gc:/Users/a123/IdeaProjects/java-example/logs/gc.log:time -XX:+PrintGC -Xlog:gc+heap=trace =XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/Users/a123/IdeaProjects/java-example/logs/dump.hprof
        /**
         * D:\IDEA_Workspaces\YadangStudy\JUC\logs
         * -XX:+HeapDumpOnOutOfMemoryError
         * -XX:HeapDumpPath
         * -XX:+PrintGCDateStamps
         * -XX:+PrintGCDetails
         */
        List<String> list = new ArrayList<>();
        while (true){
            list.add(new String(UUID.randomUUID().toString()));
        }
    }
}
